<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>浅拷贝测试</title>
  <script src="../../src/object/clone.js"></script>
</head>

<body>
  <script>
    const obj = { x: 'abc', y: { m: 1 } };
    // const result = clone1(obj);
    const result = clone2(obj);
    result.y.m = 2
    console.log(obj);
    console.log(result);
    console.log(obj === result)
  </script>
</body>

</html>